import React, { useEffect, useState } from 'react'
import { Link, Outlet, useOutletContext, useParams } from 'react-router-dom'
import { fetchDetail } from '@/request'

function Page() {
  const { LG = {} } = useOutletContext()
  const [data, setData] = useState({})
  const { id } = useParams()

  const onTapNews = (item: INewItem) => {
    console.log('onTapNews', item)
  }

  const load = async () => {
    const detail = await fetchDetail(id)
    detail && setData(detail)
  }

  useEffect(() => {
    load()
  }, [])

  console.log('detail', data)

  return (
    <div>
      <h1>detail</h1>
    </div>
  )
}

export default Page
